extends StaticBody2D

@onready var battle_ground_ui = get_tree().get_first_node_in_group("BattleGroundUI")
var Health = MySpriteData.SelectedDokiMons[2]["Health"]
var MaxHealth = MySpriteData.SelectedDokiMons[2]["Health"]
var Level = 1

func _ready():
	Level = randi_range(1,5)
	spawn()
	%Attack.hide()
	
func spawn():
	%CaptureAnimationPlayer.play("Spawn", -1,2)

func hit(anim, damage):
	Health -= damage
	%Attack.show()
	%Attack.play(anim)

func _on_attack_animation_finished():
	%Attack.hide()

func capture():
	%CaptureAnimationPlayer.play("Capture", -1,3)
	await %CaptureAnimationPlayer.animation_finished
	battle_ground_ui._on_flee_pressed()


